package ooday03;

public class Test {
    public static void main(String[] args) {
        Dog[]dogs = new Dog[3];
        dogs[0]=new Dog("小黑",2,"乳白色");
        dogs[1]=new Dog("小蓝",3,"咖啡色");
        dogs[2]=new Dog("小绿",4,"棕黑色");
        System.out.println(dogs[0].name);
        System.out.println(dogs[1].age);
        System.out.println(dogs[2].color);
        dogs[2].swim();
        for (int i = 0;i< dogs.length;i++){
            System.out.println(dogs[i].color);
        }



        Fish[] fish = new Fish[2];
        fish[0]=new Fish("小黑",2,"黑色");
        fish[1]=new Fish("小白",4,"白色");
        System.out.println(fish[0].name);
        System.out.println(fish[1].age);
        fish[1].swim();
        for (int i = 0;i< fish.length;i++){
            System.out.println(fish[i].name);
        }













        /*
        Dog dog = new Dog("小黑",2,"黑");
        dog.eat();
        dog.drink();
        dog.lookHome();
        dog.swim();

        Chick chick = new Chick("花花",3,"棕");
        chick.eat();
        chick.drink();
        chick.layEggs();
        chick.swim();

        Fish fish = new Fish("金金",1,"金");
        fish.eat();
        fish.drink();
        fish.swim();

         */
    }
}
